
import pygame
import colors

class Menu:
	
	def __init__(self, surface):
		self.surface = surface
	
	def draw(self, gamelogic):
		menu_rect = (630, 0, 170, 600)
		pygame.draw.rect(self.surface, (100, 100, 100), menu_rect)
		pygame.display.update(menu_rect)
		for i in xrange(len(gamelogic.nations)):
			if i == gamelogic.current_nation_index:
				current_rect = (636, 18+i*15, 100, 14)
				pygame.draw.rect(self.surface, (200, 200, 200), current_rect)
				pygame.display.update(current_rect)
			rect = (640, 20+i*15, 10, 10)
			pygame.draw.rect(self.surface, colors.get_color(gamelogic.nations[i].color), rect)
			
			font = pygame.font.Font(None, 17)
			text = font.render(gamelogic.nations[i].name, True, (255, 255, 255), (159, 182, 205))
			textRect = text.get_rect()
			area = (655, 20+i*15, 655 + textRect[2], 20+i*15 + textRect[3])
			self.surface.blit(text, (655, 20+i*15))
			pygame.display.update(area)
			
			pygame.display.update(rect)

